import time
from celery import Celery

# from config import Configs

'''
    仅是学习使用
'''
backend = "redis://:@localhost:6379/5"
broker = "redis://:@localhost:6379/5"

print(f"backend:{backend}")
celery = Celery("study_celery", backend=backend, broker=broker)

# 启动命令： /Users/hemq/Library/Python/3.9/bin/celery -A celery_task worker --loglevel=info
@celery.task
def output_info(name):
    print(f"我是一个 celery 异步执行函数 {name}")
    time.sleep(2)
    print(f"我是一个 celery 异步执行函数~")
    return "Done"
